<template>
  <div>
    <div class="febus-study">
      <div class="question">
        <question @update="update"></question>
      </div>
      <div class="right">
        <Indicator></Indicator>
        <timer></timer>
      </div>
    </div>
  </div>
</template>

<script>
import Question from "@/components/Test/question";
import Indicator from "@/components/Test/indicator";
import Timer from "@/components/Test/timer";
import { mapState } from "vuex";
export default {
  layout: "mine",
  async fetch({ $axios, store }) {
    await store.dispatch("questions/getRanData");
  },
  data() {
    return {
      checkedList: []
    };
  },
  mounted() {
    this.checkedList = this.app.data;
  },
  methods: {
    update(val) {
      this.checkedList = val;
    }
  },
  computed: {
    ...mapState("questions", ["randlist"]),
    app() {
      return this.randlist;
    }
  },
  components: {
    Question,
    Indicator,
    Timer
  }
};
</script>

<style scoped>
.febus-study {
  display: flex;
}

.question {
  flex-grow: 1;
}

.right {
  width: 280px;
}
</style>